-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support variable tag in benchmark #375
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look.
@@ -72,4 +91,22 @@ public static List<List<String>> getClientFiles() { | |||
public static void setClientFiles(List<List<String>> clientFiles) { | |||
CLIENT_FILES = clientFiles; | |||
} | |||
|
|||
public static Map<String, String> getTag(String deviceName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add some comments to explain it's functionality and the return value.
And, getTags ?
return res; | ||
} | ||
|
||
public static Map<String, String> getTag(int deviceId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getTags
configuration/conf/config.properties
Outdated
# 标签值前缀 | ||
# TAG_VALUE_PREFIX=value_ | ||
|
||
# 每个标签值的取值种数,使用逗号分开,设置个数应与标签名数量相等。例如TAG_NUMBER=2,TAG_VALUE_CARDINALITY=50,10,说明第一个标签名可能有50种值,第二个标签名可能有10种值 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you further describe what the complete path might look like in this scenario? Would the path be root.test.device.value_10.value_5.sensor?
private static final String TAG_VALUE_PREFIX = config.getTAG_VALUE_PREFIX(); | ||
private static final int TAG_NUMBER = config.getTAG_NUMBER(); | ||
private static final List<Integer> TAG_VALUE_CARDINALITY = config.getTAG_VALUE_CARDINALITY(); | ||
private static final long[] LEVEL_CARDINALITY = new long[TAG_VALUE_CARDINALITY.size() + 1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use List too, to keep consistent with TAG_VALUE_CARDINALITY
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me ~
Old configuration makes all devices have the same tag.
New configuration automatically generates different tags for different devices. Tags will be generated based on the hash value of the deviceName.
For example: